<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 

class Block_Admin_Edit extends Core_Block {

	public function getFormAction() {
		return App::url('*/*/save');
	}
	
	public function getBackUrl() {
		return App::url('*/*');
	}
	
	public function getRemoveUrl() {
		return App::url( '*/*/delete', array('id' => $this->getFormObject()->getId()) );
	}
	
	public function getFormObject() {
		return App::registry('form_object');
	}
	
	protected function _beforeRender() {
		$obj = $this->getFormObject();
		$title = $this->getTitle($obj);
		$this->setFormTitle($title);

		foreach($this->getChild() as $c) {
			$c->setFormObject($this->getFormObject());
		}
	}
	
	protected function getTitle() {
		return '';
	}
}